package cn.jiyun.dao;

import cn.jiyun.pojo.Cd;
import cn.jiyun.pojo.Dish;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface DishDao extends BaseMapper<Dish> {



    Page<Cd> selectPagezx(Page<Dish> page1, @Param("name") String name);

    @Update("update dish set `status`= #{status} where id= #{id}")
    void update0(@Param("id") Long id, @Param("status") Integer status);


    @Update("update dish set `status`= #{status} where id= #{id}")
    void update1(@Param("id") Long id, @Param("status") Integer status);

    @Select("select * from dish d,dish_flavor f where d.id=f.dish_id and d.id= #{id}")
    List<Cd> selectByIdcd(Long id);


    @Select("select * from dish where  id= #{id}")
    Cd selectByIddi(Long id);
}
